﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WpfControlLibrary;

namespace TimbreRecognition.Desktop
{
    public partial class Chart3DForm : Form
    {
        private Color[] colors =
        {
            Color.Red,
            Color.Green,
            Color.Blue, 
            Color.Violet, 
            Color.Orange, 
            Color.Yellow, 
            Color.LawnGreen,
            Color.Aqua,
            Color.BlueViolet,
            Color.CadetBlue,
            Color.Olive,
            Color.SpringGreen,
            Color.Purple,
            Color.Brown,
            Color.DeepPink
        };

        public Chart3DForm(Dictionary<double[], int> data)
        {
            InitializeComponent();

            Dictionary<double[], System.Windows.Media.Color> plotData = data.ToDictionary(o => o.Key, o =>
            {
                Color color = colors[o.Value];
                System.Windows.Media.Color mediaColor = System.Windows.Media.Color.FromRgb(color.R, color.G, color.B);
                return mediaColor;
            } );
            this.wpfElement.Child = new Chart3DUserControl(plotData);
        }
    }
}
